#include <stdio.h>
#include <iostream>
#include <map>
#include <string.h>
using namespace std;
map<char, string> binString;

void Init() {
    binString['0'] = "0000";
    binString['1'] = "0001";
    binString['2'] = "0010";
    binString['3'] = "0011";
    binString['4'] = "0100";
    binString['5'] = "0101";
    binString['6'] = "0110";
    binString['7'] = "0111";
    binString['8'] = "1000";
    binString['9'] = "1001";
    binString['a'] = "1010";
    binString['b'] = "1011";
    binString['c'] = "1100";
    binString['d'] = "1101";
    binString['e'] = "1110";
    binString['f'] = "1111";
}
char hexStr[16];
int main(int argc, char** argv) {
    Init();
    string s;
    while (cin>>s) {
        memset(hexStr, '0', sizeof(hexStr));
        int len = s.length();
        for (int i=0; i<len; ++i) {
            hexStr[15-i] = s[len-i-1];
        }
        for (int i=0; i<16; ++i) {
            printf("%s ", binString[hexStr[i]].c_str());
        }
        printf("\n");
    }
    return 0;
}
